<%--
    Document   : vote
    Created on : Oct 25, 2009, 10:09:20 PM
    Author     : Phong
--%>

<%@page contentType="text/html" pageEncoding="UTF-8" import="java.sql.*,DAOClass.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

        <link rel="stylesheet" href="../css/style.css" />
        <link rel="stylesheet" href="../css/front.css"  />
        <link rel="stylesheet" href="../css/backend.css" />
        <%@include file="include/validate.jsp" %>
        <title>Vote Manager</title>
    </head>


    <body>
      <%
        vote v = new vote();
        ResultSet re = null;
        re = v.allVote();
      %>

      <table width="100%" border="1">
          <thead>
          <tr>
              <th colspan="7">Vote Manager</th>
          </tr>
          <tr>
              <td>Note : 
              Display &nbsp; <img src='../images/button/system/001_15.png' alt='Display'/> &nbsp;
              Waitting &nbsp; <img src='../images/button/system/001_16.png' alt='Waitting'/> &nbsp;
              Blocked &nbsp; <img src='../images/button/system/001_17.png' alt='Blocked'/> &nbsp;
              <td colspan="6"></td>
          </tr>
<tr>
		  <td colspan="7">&nbsp;</td>
		  </tr>
          
              <tr>
                  <th width="253">Vote Name</th>
                  <th width="176">Create Date</th>
                  <th width="159">End Date</th>
                  <th width="52">Status</th>
                  <th width="32">Edit</th>
                  <th width="54">Delete</th>
                  <th width="68">AddNew</th>
              </tr>
          </thead>
          <tbody>
		  <tr>
		  <td colspan="7">&nbsp;</td>
		  </tr>
              <%
                while (re.next())   {
                    String sts = "";
                        if (re.getInt("Status") == 3){
                            sts = "<img src='../images/button/system/001_15.png' alt='Display'/>";

                        }
                    if (re.getInt("Status") == 2){
                            sts = "<img src='../images/button/system/001_16.png' alt='Waitting'/>";

                        }
                    if (re.getInt("Status") == 1){
                            sts = "<img src='../images/button/system/001_17.png' alt='Blocked'/>";

                        }

                %>

              <tr>
                  <td><%=re.getString("VoteName")%></td>
                  <td><%=re.getString("CreateTime")%></td>
                  <td><%=re.getString("EndTime")%></td>
                  <td align="center">

                  <%=sts%></td>
                  <td align="center">
                      <a href="editVote.jsp?id=<%=re.getInt("VoteID")%>" >
                      <img src="../images/button/system/24-tag-pencil_1.png" alt="Edit" border="0">
                      </a>
                  </td>
                  <td align="center"><img src="../images/button/system/24-tag-remove.png" alt="Delete" border="0"></td>
                  <td align="center"><img src="../images/button/system/24-tag-add.png" alt="AddNew" border="0"></td>
              </tr>

              <%
                      }
              %>
          </tbody>
    </table>


    </body>
</html>
